package com.yao.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author YaoXJ
 * @Date 2023-07-27
 * @Description
 */
@Component
@RocketMQMessageListener(consumerGroup = "consumer_group1", topic = "${rocketmq.consumer.topic}",
        selectorExpression = "${rocketmq.consumer.tags}", messageModel = MessageModel.BROADCASTING)
@Slf4j
public class Consumer1 implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println("Consumer1 : " + message);
    }
}
